package org.extdev.device.ltr;

import org.extdev.connection.Connection;
import org.extdev.device.Device;
import org.extdev.libraries.ltr.LTR11APILibraryFacade;
import org.extdev.libraries.ltr.LTRException;
import org.extdev.protocol.Protocol;

public class LTR11LibDevice extends Device {
	
	protected LTR11APILibraryFacade facade;
	
	public LTR11LibDevice(Connection connection, Protocol<?, ?> protocol, LTR11APILibraryFacade facade) throws LTRException {
		this.facade = facade;
		setConnection(connection);
		setProtocol(protocol);
	}
	
	public void startDataReading() throws LTRException {
		facade.startLTR11();
	}
	
	public void stopDataReading() throws LTRException {
		facade.stopLTR11();
	}
	
	public void setPointsCount(int value) {
		facade.setPointsCount(value);
	}
	
	public int getPointsCount() {
		return facade.getPointsCount();
	}
	
	public void init() throws LTRException {
		facade.inicilizeLTR11();
	}
	
	public void saveSettings() throws LTRException {
		facade.setADC();
	}
	
	public void addChannel(LTR11Channel value) {
		facade.addChannel(value);
	}
	
	public void removeChannel(int index) {
		facade.removeChannel(index);
	}
	
	public LTR11Channel getChannel(int index) {
		return facade.getChannel(index);
	}
	
	public void setStartMode(LTR11StartADCMode value) { 
		facade.setStartMode(value);
	}
	
	public LTR11StartADCMode getStartMode() {
		return facade.getStartMode();
	}
	
	public void setInputMode(LTR11InputMode value) {
		facade.setInputMode(value);
	}
	
	public LTR11InputMode getInputMode() {
		return facade.getInputMode();
	}
}
